extension :debug => :dump_strategy do
  task :dump_strategy do
    ui = outer_configuration.ui

    task_name_groups = {}
    task_chains = {}
    extension_contexts.reverse_each do |ctx|
      ctx.tasks.each do |k,v|
        next if k =~ /^_/
        (task_name_groups[ctx.substrategy] ||= []) << k unless task_chains.key? k
        (task_chains[k] ||= []) << "#{ctx.substrategy}:#{ctx.extension}"
      end
    end
    
    ui.say "strategy dump for: #{project_name}"
    ui.say "tasks:"
    ui.say "------"
    task_name_groups.keys.sort { |v1, v2| v1.to_s <=> v2.to_s }.each do |substrategy|
      task_name_groups[substrategy].sort { |v1, v2| v1.to_s <=> v2.to_s }.each do |task_name|
        ui.say "#{task_name}: #{task_chains[task_name].join(" => ")}"
      end
      ui.say "\n"
    end
  end
end

configuration :base do
  use :debug => :dump_strategy
end